package com.cndw.kungfu.model.task;

import com.cndw.kungfu.config.ConstantsTask;

/**
 * 任务需要的条件
 * 
 * @author fantadust [9677889@qq.com]
 * @date 2011-8-16 下午4:20:58
 */
public class TaskCondition {

	private int action;// 类型
	private int targerId;// 目标
	private int count = 1;
	private String desc;

	public int getAction() {
		return action;
	}

	public void setAction(int action) {
		this.action = action;
	}

	public int getTargerId() {
		return targerId;
	}

	public void setTargerId(int targerId) {
		this.targerId = targerId;
	}

	public int getCount() {
		count = count <= 0 ? 1 : count;
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	/**
	 * 是否是杀怪任务
	 * 
	 * @return
	 */
	public boolean isKill() {
		return action == ConstantsTask.actionKill;
	}

	/**
	 * 是否需要任务品
	 * 
	 * @return
	 */
	public boolean isCollectGoods() {
		return action == ConstantsTask.actionCollect || action == ConstantsTask.actionGather;
	}

	public boolean isSpark() {
		return action == ConstantsTask.actionSpark;
	}

	/**
	 * 是否是检测条件
	 * 
	 * @return
	 */
	public boolean isDetect() {
		return action == ConstantsTask.actionDetect;
	}

	/**
	 * 判断是否完成
	 */
	public void isReached() {

	}

}
